package ge.modules.physics;

import ge.lowlevel.box2d.FactoryBox2D;
import ge.lowlevel.box2d.RevolutionJointGe;
import ge.modules.Module;
 

public class PhysicRevolutionJoint implements Module 
{
	public RevolutionJointGe juntafija;
	
	/**
	 * 	Revolution Joint with the physic world in the (x,y) position
	 * @param box The PhysicBox module
	 * @param x Position x in pixels
	 * @param y Position y in pixels
	 */
	public PhysicRevolutionJoint(PhysicBoxModule box)
	{
		double escala = FactoryBox2D.getActualWorld().getScale();
		double x = box.getPhysic().getX();
		double y = box.getPhysic().getY();
		juntafija = FactoryBox2D.get().newRevolutionJoint(FactoryBox2D.getActualWorld(), box.getPhysic(),x , y);
		
	}
	/**
	 * 	Revolution Joint with the physic world in the (x,y) position
	 * @param box The PhysicBox module
	 * @param x Position x in pixels
	 * @param y Position y in pixels
	 */
	public PhysicRevolutionJoint(PhysicBoxModule box, double x, double y)
	{
		double escala = FactoryBox2D.getActualWorld().getScale();
		juntafija = FactoryBox2D.get().newRevolutionJoint(FactoryBox2D.getActualWorld(), box.getPhysic(),x/escala , y/escala);
		
	}
	
	/**
	 * evolution Joint with the physic world between two boxes
	 * @param box1 First Box
	 * @param box2 Second box
	 * @param x Position x in pixels
	 * @param y Position y in pixels
	 */
	public PhysicRevolutionJoint(PhysicBoxModule box1 ,PhysicBoxModule box2 , double x, double y)
	{
		double escala = FactoryBox2D.getActualWorld().getScale();
		juntafija = FactoryBox2D.get().newRevolutionJoint(box1.getPhysic(), box2.getPhysic(),x/escala , y/escala);
		
	}
	
	
	@Override
	public void update() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void draw() {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void delete() {
		// TODO Auto-generated method stub
		
	}

}
